package com.opp1.fengzhuang;

/*
1.提高程序的安全性，保护数据
2.隐藏代码得实现细节
3.统一接口get/set
4.系统可维护性增加了
 */

public class Application {
    public static void main(String[] args) {
        Student s1 = new Student();
        s1.setName("小米");
        System.out.println(s1.getName());//println方法得重载

        s1.setId(2003140314);
        System.out.println(s1.getId());

        s1.setSex('男');
        System.out.println(s1.getSex());

        s1.setAge(-9);//不合法得
        System.out.println(s1.getAge());
    }
}
